import request from '../utils/request';


export default {
    /**
     * 查询字典列表分页
     * @param query
     * @returns {AxiosPromise}
     */
    selectPage : query => {
        return request({
            url: '/dictionary/selectPage',
            method: 'POST',
            data: query
        });
    },


    /**
     * 新增字典
     * @param query
     * @returns {AxiosPromise}
     */
    addDictionary : query => {
        return request({
            url: '/dictionary/insert',
            method: 'POST',
            data: query
        });
    },


    /**
     * 编辑字典
     * @param query
     * @returns {AxiosPromise}
     */
    updateDictionary : query => {
        return request({
            url: '/dictionary/update',
            method: 'POST',
            data: query
        });
    },

    /**
     * 删除字典
     * @param query
     * @returns {AxiosPromise}
     */
    delDictionary : query => {
        return request({
            url: '/dictionary/delete',
            method: 'POST',
            data: query
        });
    },

    /**
     * 查询分组
     * @param query
     * @returns {AxiosPromise}
     */
    selectDicGroup : query => {
        return request({
            url: '/dictionary/selectGroup',
            method: 'POST',
            data: query
        });
    },

    /**
     * 查询字典表
     * @param query
     * @returns {AxiosPromise}
     */
    getDictionaryByID : query => {
        return request({
            url: '/dictionary/' + query,
            method: 'POST',
        });
    },

    /**
     * 查询字典表List
     * @param query
     * @returns {AxiosPromise}
     */
    getDictionarys : query => {
        return request({
            url: '/dictionary/getDictionarys?groupName=' + query,
            method: 'POST',
        });
    }
}
